Chris Pollett > Old Classes >
CS116a

( Print View )

Student Corner:
  [Grades Sec1]

  [Submit Sec1]

  [Email List Sec1]

  [
Lecture Notes]

Course Info:
  [Texts & Links]
  [Topics]
  [Grading]
  [HW Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Announcements]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]

Practice Exams:
  [Mid1]  [Mid2]  [Final]

                           












CS116a Fall 2004Practice Midterm 1

[Student Generated Solutions]

To study for the midterm I would suggest you: (1) Know how to do (by heart) all the practice problems. (2) Go over your notes three times. Second and third time try to see how huch you can remember from the first time. (3) Go over the homework problems. (4) Try to create your own problems similar to the ones I have given and solve them. (5) Skim the relevant sections from the book. (6) If you want to study in groups, at this point you are ready to quiz each other. The practice midterm is below. Here are some facts about the actual midterm: (a) The midterm will be in class . (b) It is closed book, closed notes. Nothing will be permitted on your desk except your pen (pencil) and test. (c) You should bring photo ID. (d) There will be more than one version of the test. Each version will be of comparable difficulty. (e) If your cell-phone or beeper goes off you will be excused from the test at that point and graded on what you have done till your excusal. (f) One problem (less typos) on the actual test will be from the practice test.

1. Recall in HW1 you wrote a function with prototype:

void circleArcMidpoint(GLint xc, GLint yc, GLint r, GLfloat startTheta, GLfloat endTheta);

Describe how your program computed the first and last pixel to draw.

2. Briefly with code explain how to create a window with GLUT, set a display callback function, and start the GLUT event loop.

3. Consider the line y =-3x +20. Suppose we have just plotted the point (5,5). Explain how Bresenham would determine the next pixel to plot. Say which direction you are assuming the plotting is going. Give that pixel's coordinates.

4. Assume we are using 8 bits of color. Let Addr(0,0) be the memory address of the start of the frame buffer. Assume the screen is 100 pixels wide. What is the pixel address of (10, 50)? Show work.

5. Give the decision parameter function for the midpoint ellipse algorithm.

6. Give a degree 3 polynomial that goes through the points (2,9), (4,6), (6,22), (7,13).

7. For each of the pieces in the game Tetris, draw it. Then say which of these pieces is convex and which is concave. Pick one of the concave figures. Show how a computer algorithm might determine that it is concave and then explain how an algorithm could be used to split it into a set of convex figures.

8. Give the OpenGL needed to draw a bitmap on the screen.

9. Explain how to use OpenGL display lists.

10. Explain how to do color blending in OpenGL. Define the terms soft-fill and tint-fill.